<template>
  <!--  -->
  <div class="main">
    <div class="content flex" @click="lo">导出</div>
  </div>
</template>

<script setup>
import { onMounted } from "vue";
import { readExcel, outExcel } from "./execl";
import useUtils from "@/utils";
const { $common, $router, $store, $global } = useUtils();

function lo() {
  outExcel({
    filename: "测试",
    header: [
      {
        title: "小猫",
        width: 10,
        key: "cat",
      },
      {
        title: "小狗",
        width: 20,
        key: "dog",
        type: "select",
        selectList: ["柴犬", "哈士奇", "泰迪"],
      },
      {
        title: "小猫图片",
        width: 10,
        key: "catImage",
        type: "image",
        max: 3,
      },
      {
        title: "小狗图片",
        width: 10,
        key: "dogImage",
        type: "image",
        max: 9,
      },
    ],
    table: [
      {
        dog: "柴犬",
        cat: "梅里猫",
        dogImage: [
          $common.require("/src/assets/404/404.png"),
          $common.require("/src/assets/404/404.png"),
          $common.require("/src/assets/404/404.png"),
        ],
        catImage: "",
      },
      {
        dog: "柴犬2",
        cat: "梅里猫2",
        dogImage: [$common.require("/src/assets/404/404.png")],
        catImage: [$common.require("/src/assets/404/404.png")],
      },
    ],
    before: (ws, next) => {
      console.log(ws);
      next();
    },
  });
}
</script>
<style lang="scss" scoped></style>
